<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <script src="../js/vue.js"></script>
    </head>
    <body>
        <div id="app" v-my-directive="true">
        </div>
    </body>
    <script>
        let MyPlugin = {};
        MyPlugin.install = function(Vue,options){
            console.log(options);
            //在插件中提供自定义指令功能，注册自定义指令
            Vue.directive('my-directive',{
                bind(el,binding){
                    el.style="width:100px;height:100px;background-color:#ccc";
                }
            });
        }
        Vue.use(MyPlugin,{ someOption:true });
        var vm = new Vue({                   
            el: '#app',
        });
    </script>
</html>